package me.lovatcat.springboot.demo.web.controller;

import io.swagger.annotations.ApiOperation;
import me.lovetcat.common.dto.RespDto;
import me.lovatcat.springboot.demo.vo.Author;
import me.lovatcat.springboot.demo.vo.Car;
import me.lovatcat.springboot.demo.vo.Computer;
import me.lovatcat.springboot.demo.vo.Mobile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author acat on 2017-01-12 13:50
 */
@RestController
public class PropertiesController {

    @Autowired
    private Author author;

    @Autowired
    private Car car;

    @Autowired
    private Mobile mobile;

    @Autowired
    private Computer computer;

    @ApiOperation(value = "作者")
    @GetMapping("/author")
    public RespDto<Author> getAuthor(){
        return RespDto.ok(author);
    }

    @ApiOperation(value = "汽车")
    @GetMapping("/car")
    public RespDto<Car> getCar(){
        return RespDto.ok(car);
    }

    @ApiOperation(value = "手机")
    @GetMapping("/mobile")
    public RespDto<Mobile> getMobile(){
        return RespDto.ok(mobile);
    }

    @ApiOperation(value = "电脑")
    @GetMapping("/computer")
    public RespDto<Computer> getComputer(){
        return RespDto.ok(computer);
    }

}
